<template>
  <a-table :columns="tableColumns" :pagination="false" :data-source="dataSource" :scroll="{ x: 900, y: tableHeight - 120 }" rowKey="id">
    <!-- 操作信息 -->
    <template slot="applyUserName" slot-scope="status, record">
      <p>时间：{{ record.applyTime }}</p>
      <p>操作人：{{ record.applyUserName }}</p>
    </template>
    <!-- 主播信息 -->
    <template slot="name" slot-scope="status, record">
      <p>姓名：{{ record.name }}</p>
      <p>电话：{{ record.phoneNumber }}</p>
      <p>ID：{{ record.idSign }}</p>
    </template>
    <!-- 申请信息 -->
    <template slot="settlementTypeDesc" slot-scope="status, record">
      <p>结算类型：{{ record.settlementTypeDesc }}</p>
      <p>合作时间：{{ record.cooperateStartTime }} - {{ record.cooperateEndTime }}</p>
    </template>
    <!-- 合作状态 -->
    <!-- 1审核中;2已通过;3审核失败;4已到期 0未提交-->
    <!-- 0李佳霓审核中;1任林艳审核中;2已通过;3李佳霓已驳回;4任林艳已驳回 -->
    <template slot="status" slot-scope="text, record">
      <span :class="[record.status === 3 || record.status === 4 ? 'color-f55' : null]">
        {{ record.statusDesc || '--' }}
        <a-tooltip v-if="record.status === 3 || record.status === 4">
          <template slot="title">
            {{ record.refusedReason }}
          </template>
          <a-icon type="info-circle" class="color-f55" />
        </a-tooltip>
      </span>
    </template>
    <!-- 操作 -->
    <template slot="action" slot-scope="text, record">
      <slot name="action" :row="record"></slot>
    </template>
  </a-table>
</template>
<script>
export default {
  name: 'cooperTable',
  props: {
    dataSource: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      tableColumns: [
        { title: 'ID', width: 100, dataIndex: 'id' },
        { title: '操作信息', width: 220, dataIndex: 'applyUserName', scopedSlots: { customRender: 'applyUserName' } },
        { title: '主播信息', width: 220, dataIndex: 'name', scopedSlots: { customRender: 'name' } },
        { title: '渠道经理', width: 180, dataIndex: 'auditChannelManagerName' },
        { title: '申请信息', width: 200, dataIndex: 'settlementTypeDesc', scopedSlots: { customRender: 'settlementTypeDesc' } },
        { title: '合作模式状态', width: 120, dataIndex: 'status', scopedSlots: { customRender: 'status' } },
        { title: '操作', fixed: 'right', width: 100, dataIndex: 'action', scopedSlots: { customRender: 'action' } }
      ]
    }
  }
}
</script>
<style scoped lang="scss">
.color-f55 {
  color: #f55f4e !important;
}
</style>
